#/bin/bash

# Create an array with folder names
folders=("src" "build")

# Check if each folder in the array exists
for folder in "${folders[@]}"
do
    if [ ! -d "$folder" ]; then
        # If the folder does not exist, create it
        echo "Creating $folder directory"
        mkdir "$folder"
	else
		echo "$folder is already installed"
    fi
done

# Check if gcc is installed
if command -v gcc >/dev/null 2>&1 ; then
  echo "gcc is already installed"
else
  echo "Installing gcc..."
  sudo apt-get update
  sudo apt-get install -y gcc
fi

# Check if gdb is installed
if command -v gdb >/dev/null 2>&1 ; then
  echo "gdb is already installed"
else
  echo "Installing gdb..."
  sudo apt-get update
  sudo apt-get install -y gdb
fi

# install extension
code --install-extension rioj7.command-variable

